/**
 * 
 */
package net.oauth.core.parameters.oauth1;

import net.oauth.core.OAuthParameters;
import net.oauth.util.OAuth1Constants;

/**
 * @author Buhake Sindi
 * @since 27 January 2012
 *
 */
public class OAuth1Parameters extends OAuthParameters {
	
//	public static final String OAUTH_BODY_HASH = "oauth_body_hash";
	public static final String OAUTH_CALLBACK = "oauth_callback";
	public static final String OAUTH_CALLBACK_CONFIRMED = "oauth_callback_confirmed";
	public static final String OAUTH_CONSUMER_KEY = "oauth_consumer_key";
	public static final String OAUTH_NONCE = "oauth_nonce";
	public static final String OAUTH_TOKEN = "oauth_token";
	public static final String OAUTH_SIGNATURE_METHOD = "oauth_signature_method";
	public static final String OAUTH_SIGNATURE = "oauth_signature";
	public static final String OAUTH_TIMESTAMP = "oauth_timestamp";
	public static final String OAUTH_TOKEN_SECRET = "oauth_token_secret";
	public static final String OAUTH_VERIFIER = "oauth_verifier";
	public static final String OAUTH_VERSION = "oauth_version";

//	private String realm;
//	private String consumerKey;
//	private String token;
//	private String signatureMethod;
//	private long timestamp;
//	private String nonce;
//	private String callback;
//	private String verifier;
//	private String signature;
//	private String version = OAuth1Constants.OAUTH_VERSION;
	
	/**
	 * 
	 */
	public OAuth1Parameters() {
		// TODO Auto-generated constructor stub
		super();
	}

	/**
	 * @return the consumerKey
	 */
	public String getConsumerKey() {
		return get(OAUTH_CONSUMER_KEY);
	}

	/**
	 * @param consumerKey the consumerKey to set
	 */
	public void setConsumerKey(String consumerKey) {
		put(OAUTH_CONSUMER_KEY, consumerKey);
	}

	/**
	 * @return the token
	 */
	public String getToken() {
		return get(OAUTH_TOKEN);
	}

	/**
	 * @param token the token to set
	 */
	public void setToken(String token) {
		put(OAUTH_TOKEN, token);
	}

	/**
	 * @return the signatureMethod
	 */
	public String getSignatureMethod() {
		return get(OAUTH_SIGNATURE_METHOD);
	}

	/**
	 * @param signatureMethod the signatureMethod to set
	 */
	public void setSignatureMethod(String signatureMethod) {
		put(OAUTH_SIGNATURE_METHOD, signatureMethod);
	}

	/**
	 * @return the timestamp
	 */
	public long getTimestamp() {
		return Long.parseLong(get(OAUTH_TIMESTAMP));
	}

	/**
	 * @param timestamp the timestamp to set
	 */
	public void setTimestamp(long timestamp) {
		put(OAUTH_TIMESTAMP, String.valueOf(timestamp));
	}

	/**
	 * @return the nonce
	 */
	public String getNonce() {
		return get(OAUTH_NONCE);
	}

	/**
	 * @param nonce the nonce to set
	 */
	public void setNonce(String nonce) {
		put(OAUTH_NONCE, nonce);
	}

	/**
	 * @return the callback
	 */
	public String getCallback() {
		return get(OAUTH_CALLBACK);
	}

	/**
	 * @param callback the callback to set
	 */
	public void setCallback(String callback) {
		put(OAUTH_CALLBACK, callback);
	}

	/**
	 * @return the verifier
	 */
	public String getVerifier() {
		return get(OAUTH_VERIFIER);
	}

	/**
	 * @param verifier the verifier to set
	 */
	public void setVerifier(String verifier) {
		put(OAUTH_VERIFIER, verifier);
	}

	/**
	 * @return the signature
	 */
	public String getSignature() {
		return get(OAUTH_SIGNATURE);
	}

	/**
	 * @param signature the signature to set
	 */
	public void setSignature(String signature) {
		put(OAUTH_SIGNATURE, signature);
	}

	/**
	 * @return the version
	 */
	public String getVersion() {
		return get(OAUTH_VERSION);
	}

	/**
	 * @param version the version to set
	 */
	public void setVersion(String version) {
		put(OAUTH_VERSION, version);
	}
	
	/**
	 * Set the version to "1.0" as specified on RFC 5849.
	 */
	public void setVersion() {
		setVersion(OAuth1Constants.OAUTH_VERSION);
	}
}
